﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;

namespace JQueryControlToolkit.Sample.Web.Samples
{
    public partial class Autocomplete : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var ajax = JQuery.Ajax();
            ajax.Url = autocomplete.Url;
            autocomplete.Url = null;
            ajax.Success = new DomOperation() { Code = "function(data){ response(data.d); }" };
            ajax.Data = new DomResult();
            ((DomResult)ajax.Data).AddOperation("", null, "{prefix: request.term}");
            ajax.Cache = false;
            autocomplete.Source = new DomResult();
            ((DomResult)autocomplete.Source).AddParameter("request");
            ((DomResult)autocomplete.Source).AddParameter("response");
            ((DomResult)autocomplete.Source).AddOperation("Ajax", ajax, "$.ajax");
        }


    }
}
